package com.teamwechat.mapper;

import com.teamwechat.pojo.Contacts;
import com.teamwechat.pojo.TbCheckin;
import com.teamwechat.pojo.TbUser;
import com.teamwechat.pojo.vo.TbUserVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

/**
* @author 我为檐上两寸雪
* @description 针对表【tb_user(用户表)】的数据库操作Mapper
* @createDate 2024-06-16 15:26:55
* @Entity com.teamwechat.pojo.TbUser
*/
@Mapper
public interface TbUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(TbUserVo record);

    int insertSelective(TbUser record);

    TbUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(TbUser record);

    int updateByPrimaryKey(TbUser record);

    public boolean haveRootUser();


    //插入数据,返回用户ID
    public int insertInt(TbUserVo user);

    public Set<String> searchUserPermissions(int userId);

    public Integer searchIdByOpenId(String openId);

    public TbUser searchById(int userId);

    public void insert(TbCheckin checkin);

    public HashMap searchNameAndDept(int userId);

    public String searchUserHiredate(int userId);

    public HashMap searchUserSummary(int userId);
    public ArrayList<HashMap> searchUserGroupByDept(String keyword);

    public ArrayList<HashMap> searchMembers(List param);

    public HashMap SearchUserinfomation(int userId);

//    List<TbUser> getAllUsers();
    public TbUser getUserById(Integer id);

    public ArrayList<HashMap> searchcontacts(HashMap map);

    public ArrayList<HashMap> addtel(HashMap map);

//    @Insert("INSERT INTO contacts (id,name,tel,email,deptId) values(#{id}},#{name},#{tel},#{email},#{deptId}} )")
//    void insert(TbUser tbUser);

    @Insert("INSERT INTO contacts (name, tel, email, dept_id) VALUES ( #{name}, #{tel}, #{email}, #{deptName})")
    void insert(Contacts contacts);



}
